#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		long long a, b;
		long long sum = 0;
		cin >> a >> b;
		sum = (a % 100 + b % 100) % 100;
		cout << sum << endl;
	}
	return 0;
}